﻿<UserControl x:Class="N6SCRM.APP.Controls.AnimatedLogo"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>


        <Viewport3D Margin="4,4,4,4" Name="viewPort">
            <ModelVisual3D>
                <ModelVisual3D.Content>
                    <Model3DGroup>
                        <!-- Lights -->
                        <AmbientLight Color="Black" />
                        <DirectionalLight Color="LightGray" Direction="1,-2,-3" />
                        <DirectionalLight Color="White" Direction="-1,2,3" />

                        <GeometryModel3D>
                            <GeometryModel3D.Geometry>
                                <!-- Cube -->
                                <MeshGeometry3D TextureCoordinates="-1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1 -1 1 -1 -1 1 -1 1 1"
                    Positions="
                      -1,-1,-1   1,-1,-1   1,-1, 1  -1,-1, 1
                      -1,-1, 1   1,-1, 1   1, 1, 1  -1, 1, 1
                       1,-1, 1   1,-1,-1   1, 1,-1   1, 1, 1
                       1, 1, 1   1, 1,-1  -1, 1,-1  -1, 1, 1
                      -1,-1, 1  -1, 1, 1  -1, 1,-1  -1,-1,-1 
                      -1,-1,-1  -1, 1,-1   1, 1,-1   1,-1,-1
                      "
                    TriangleIndices="
                       0  1  2     2  3  0
                       4  5  6     6  7  4
                       8  9 10    10 11  8
                      12 13 14    14 15 12
                      16 17 18    18 19 16
                      20 21 22    22 23 20
                      " />


                            </GeometryModel3D.Geometry>

                            <GeometryModel3D.Material>
                                <MaterialGroup>
                                    <DiffuseMaterial>
                                        <DiffuseMaterial.Brush>

                                            <ImageBrush ImageSource="../images/Ceres-icon.png" Opacity="1"></ImageBrush>
                                        </DiffuseMaterial.Brush>

                                    </DiffuseMaterial>

                                    <DiffuseMaterial>
                                        <DiffuseMaterial.Brush>
                                            <SolidColorBrush Color="Transparent" Opacity=".2"></SolidColorBrush>
                                        </DiffuseMaterial.Brush>
                                    </DiffuseMaterial>

                                </MaterialGroup>




                            </GeometryModel3D.Material>

                        </GeometryModel3D>

                    </Model3DGroup>
                </ModelVisual3D.Content>
            </ModelVisual3D>

            <Viewport3D.Camera>
                <PerspectiveCamera x:Name="camera" 
          Position = "2, 4, 6"
          LookDirection = "-1, -2, -3"
          UpDirection = "0, 1, 0"
          FieldOfView = "30">
                    <PerspectiveCamera.Transform>
                        <Transform3DGroup>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D
                      Axis="0 1 0" 
                      Angle="{Binding ElementName=hscroll, Path=Value}" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                            <RotateTransform3D>
                                <RotateTransform3D.Rotation>
                                    <AxisAngleRotation3D x:Name="axisanglerotation"
                      Axis="1 0 0" 
                      Angle="{Binding ElementName=vscroll, Path=Value}" />
                                </RotateTransform3D.Rotation>
                            </RotateTransform3D>
                        </Transform3DGroup>
                    </PerspectiveCamera.Transform>
                </PerspectiveCamera>
            </Viewport3D.Camera>
        </Viewport3D>




    </Grid>
</UserControl>
